package com.pbxadmin.cfg;

import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;

import com.google.gson.reflect.TypeToken;
import com.pbxadmin.pojo.Meet;
import com.pbxadmin.pojo.OutRule;
import com.pbxadmin.pojo.Route;
import com.pbxadmin.pojo.RxFax;
import com.pbxadmin.pojo.SipPeers;
import com.pbxadmin.pojo.SipTrunk;

public class WSConstants {
	// 路由列表类型
	public static Type mapRoute = new TypeToken<Map<String, Route>>() {
	}.getType();
	// 分机列表类型
	public static Type listSipPeers = new TypeToken<List<SipPeers>>(){}.getType();
	
	// SIP中继列表类型
	public static Type mapSipTrunk = new TypeToken<Map<String, SipTrunk>>() {
	}.getType();

	// Ivr类型
	public static Type mapIvr = new TypeToken<Map<String, Map<String, String>>>() {
	}.getType();
	
	// 会议
	public static Type mapMeet = new TypeToken<Map<String, Meet>>() {
	}.getType();
	
	// 接收传真列表
	public static Type mapRxFax = new TypeToken<Map<String, RxFax>>() {
	}.getType();
	
	// 外拨路由规则
	public static Type mapOutRule = new TypeToken<Map<String, OutRule>>() {
	}.getType();

	// 路由类型
	public static final String TYPE_IVR = "to-ivr"; // IVR
	public static final String TYPE_QUEUE = "to-queue"; // 队列
	public static final String TYPE_MEET = "to-meet"; // MEET
	public static final String TYPE_RXFAX = "to-rxfax"; // 接收传真
	public static final String TYPE_IN = "to-in"; // 分机
	public static final String TYPE_OUT = "to-out"; // 外线

	// 外拨权限
	public static final String ACCESS_INTERNATIONAL = "I"; // 国际号码
	public static final String ACCESS_NATIONAL = "N"; // 国内号码
	public static final String ACCESS_LOCAL = "L"; // 市话号码

	// IVR动作类型
	public static final String ATYPE_SWITCH = "switch"; // 普通交换菜单,如:请直拨分机号查号请播0
	public static final String ATYPE_FIELD = "field"; // 菜单放音
	public static final String ATYPE_PLAY = "play"; // 放音
	public static final String ATYPE_RECORD = "record"; // 留言录音
	public static final String ATYPE_TRANS = "trans"; // 转移
	public static final String ATYPE_EXIT = "exit"; // 结束挂机
	
	//返回结果类型
	public static final String RTN_SUCCESS = "0"; // 操作成功
	public static final String RTN_FAIL_FIELDS_ERROR = "101"; // 参数有误
	public static final String RTN_FAIL_TT_ERROR = "102"; // 类型目标不存在
	public static final String RTN_FAIL_SIPTRUNK_STARTWITH_G = "104"; // siptrunk 不能以g开头
}
